[package]
name = "ztunnel"
version = "0.0.0"
edition = "2021"
rust-version = "1.65"

[features]
default = ["fips"]
gperftools = ["dep:gperftools"]
console = ["dep:console-subscriber"]
fips = ["boring/fips", "hyper-boring/fips", "tokio-boring/fips"]
testing = [] # Enables utilities supporting tests.

[lib]
path = "src/lib.rs"
bench = false

[[bin]]
name = "ztunnel"
path = "src/main.rs"
bench = false

[[bench]]
name = "throughput"
harness = false

[dependencies]
#tikv-jemallocator = { version = "0.5", features = ["profiling", "stats"]}
anyhow = "1.0"
async-stream = "0.3.3"
async-trait = "0.1.58"
atty = "0.2"
# Fork will be dropped once Hyper goes 1.0.0
hyper-boring = { git = "https://github.com/howardjohn/boring/", branch = "hyper-boring/adopt-hyper-1.0.0-rc4" }
boring = { git = "https://github.com/howardjohn/boring/", branch = "hyper-boring/adopt-hyper-1.0.0-rc4" }
tokio-boring = { git = "https://github.com/howardjohn/boring/", branch = "hyper-boring/adopt-hyper-1.0.0-rc4" }
bytes = { version = "1", features = ["serde"] }
console-subscriber = { version = "0.1.6", optional = true }
drain = "0.1.1"
futures = "0.3.12"
gperftools = { version = "0.2.0", features = ["heap"], optional = true }
hyper = { version = "1.0.0-rc.4", features = ["full"] }
# Pending https://github.com/hyperium/hyper-util/pull/25, https://github.com/hyperium/hyper-util/pull/24
hyper-util = { git = "https://github.com/howardjohn/hyper-util", branch = "h2-timer-expose-exec-rc4", features = ["full"] }
libc = "0.2.126"
log = "0.4"
once_cell = "1.16.0"
pprof = { version = "0.11.0", features = ["protobuf", "protobuf-codec", "criterion"] }
prometheus-client = { version = "0.19.0" }
prost = "0.11"
prost-types = "0.11.1"
rand = "0.8.5"
serde = { version = "1", features = ["derive", "rc"] }
serde_json = "1.0"
serde_yaml = "0.9"
socket2 = { version = "0.5", features = ["all"] }
byteorder = "1.3.4"
thiserror = "1.0.38"
tls-listener = { version = "0.6.0" }
tokio = { "version" = "1", features = ["full", "test-util"] }
tokio-stream = { version = "0.1.12", features = ["net"] }
tonic = { version = "0.8", default-features = false, features = ["prost", "codegen"] }
tower = { version = "0.4.12", features = ["full"] }
tracing = "0.1.34"
tracing-subscriber = { version = "0.3.16", features = ["registry", "env-filter"] }
realm_io = "0.4"
go-parse-duration = "0.1.1"
prometheus-parse = "0.2.3"
url = "2.2"
itertools = "0.10.5"
ipnet = { version = "2.7.0", features = ["serde"] }
http-types = { version = "2.12.0", default-features = false }
textnonce = { version = "1.0.0" }
priority-queue = "1.3.0"
http-body-util = "0.1.0-rc.2"
http-body-04 = { package = "http-body", version = "0.4" }
http-body-1 = { package = "http-body", version = "1.0.0-rc.2" }
tower-hyper-http-body-compat = { version = "0.2", features = ["server", "http2"] }
futures-util = "0.3.26"
chrono = "0.4.23"
nix = { version = "0.27.1", features = ["socket", "sched", "uio", "fs", "ioctl", "user"] }
hashbrown = "0.14.0"
backoff = "0.4.0"

# DNS
hickory-client = "0.24.0"
hickory-proto = "0.24.0"
hickory-resolver = "0.24.0"
hickory-server = { version = "0.24.0", features = [ "hickory-resolver" ] }
duration-str = "0.7.0"

[target.'cfg(target_os = "linux")'.dependencies]
netns-rs = "0.1.0"

[build-dependencies]
tonic-build = { version = "0.8", default-features = false, features = ["prost"] }
prost-build = "0.11"
anyhow = "1.0.65"
rustc_version = "0.4.0"

[profile.release]
opt-level = 3
codegen-units = 1
lto = true

# Release optimized but without as many dependencies, suitable for incremental development
[profile.quick-release]
inherits = "release"
codegen-units = 16
lto = false
incremental = true

[dev-dependencies]
# Enable testing utils on this crate.
ztunnel = { version = "0.0.0", path = ".", features = [ "testing" ] }

criterion = { version = "0.4.0", features = ["async_tokio", "html_reports"] }
diff = "0.1.13"
local-ip-address = "0.5.3"
matches = "0.1.9"
test-case = "3.0.0"
#debug = true
